package com.yyi.springcloud.controller;


import com.yyi.springcloud.entities.SubWindowConfigModel;
import com.yyi.springcloud.service.Local_SubWindowConfigService;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.annotation.Resource;
import java.util.List;

@Controller
@RequestMapping("/mysqlapi/SubWindowConfig")
public class Mysql_SubWindowConfigController {
	@Resource
	private Local_SubWindowConfigService subWindowConfigService;

	//根据条件查询子窗口信息
	//http://localhost:8080/bxxs/mysqlapi/SubWindowConfig/getSubWindowConfigInfo
	@ResponseBody
	@RequestMapping(value = "/getSubWindowConfigInfo", method = RequestMethod.GET)
	public List<SubWindowConfigModel> getSubWindowConfigInfo(String labcode) {
		SubWindowConfigModel subWindowConfigModel=new SubWindowConfigModel();
		if(!StringUtils.isEmpty(labcode)){
			subWindowConfigModel.setLabcode(labcode);
		}
		List<SubWindowConfigModel> subWindowConfigModelList = subWindowConfigService.getSubWindowConfigModelByCondition(subWindowConfigModel);
		return subWindowConfigModelList;
	}
}
